#!C:\Python26_32bit

from obstacle   import *
from plane      import *
from sphere     import *
from cube       import *

a = Plane(4, 5, 6, 7, 8, 67, 325)
print a.middle
print a.normal

a.StaticMove(1,2,3)
a.StaticResize(4)
a.Resize(3,6)
print a.resizeSpeed
print "----------"
print a.vertices[0][0]
print a.vertices[0][1]
print a.vertices[0][2]
print "----------"
print a.normals
print "----------"
print a.inverseNormals
a.Resize(3,7)
a.BoundNormals()

print "~~~~~~~~~~"
a = Plane(10, 15, 6, 7, 8, 1, 100)
print a.middle
print a.normal
print "Boundary normals:"
print a.boundaryNormals
a.BoundNormals()
print "Static move..."
a.StaticMove(3,1,5);
print a.boundaryNormals
print a.middle
p = numpy.array([3, 10, -1]);
p2 = numpy.array([3, 11, -1]);
#a.CollisionHandle(p, p);
print 'Before: ';
print p;
p = a.CollisionHandle(p, p2);
print 'After: ';
print p;

print 'Sphere testing'
a = Sphere(1,2,3,10);
print 'Middle pt after initialization:'
print a.middle;
p1 = numpy.array([4.3,2.2,0.3]);
print 'Before collision'
print p1
p1 = a.CollisionHandle(p1, numpy.array([2,3,4]))
print 'After collision'
print p1;
a.SetState(2);
a.StaticMove(-5.123,2.54,3.111);
print 'Middle pt after static move:'
print a.middle;
print a.futureRadius
a.Resize(5,1.5);
print a.futureRadius
print a.radius
a.StaticResize(1.43);
print a.radius

print 'Cube testing'
a = Cube(1,2,3,10);
print 'Vertices'
print a.vertices
print 'Walls'
print a.walls
print 'Inv. walls'
print a.invWalls
print 'Future size'
print a.futureSize
a.StaticMove(0.56,-2.1,0.1109);
print a.vertices;
a.StaticResize(2.45)
print a.futureSize
a.Resize(1.5, 0.7)
print a.futureSize
a.Rotate(4,6,-1,1)
print 'Vertices before resizing'
print a.vertices
a.StaticResize(1.4)
print 'Vertices after resizing'
print a.vertices
point = numpy.array([1,2,3]);
print point
point = a.CollisionHandle(point,numpy.array([4,8,3]));
print point